package com.rahwi.rahwi_server.Utils.Converter;

import com.rahwi.rahwi_server.Entity.Reply;
import com.rahwi.rahwi_server.vo.data.BaseReply;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName ReplyConverter
 * @Description 将实体类转换为前端所需数据对象
 * @Date 2021/12/10 12:30
 * @Autor mjw
 * @Version 1.0
 */
public class ReplyConverter {

    public static BaseReply toBaseReply(Reply reply , ICopy<BaseReply,Reply> iCopy){
        return iCopy.Copy(reply);
    }
    public static List<BaseReply> toBaseReplies(List<Reply> replies, ICopy<BaseReply,Reply> iCopy){
        List<BaseReply> baseReplies = new ArrayList<BaseReply>();
        for(Reply reply: replies){
            baseReplies.add(iCopy.Copy(reply));
        }
        return baseReplies;
    }
}
